package com.claa.springboot.controller;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.claa.springboot.dao.EmployeeDao;
import com.claa.springboot.entities.Employee;

/**
 * 员工管理
 * @author 0283000121
 *
 */
@Controller
public class EmpContorller {
	@Autowired
	EmployeeDao employeeDao;
	
	/**
	 * 员工列表，整体浏览
	 * @return
	 */
	@GetMapping("/emps")
	public String emps(Model model) {
		Collection<Employee> emps = employeeDao.getAll();
		model.addAttribute("emps", emps);
		return "emps/list";
	}
}
